package org.sny7.openOfflineList.util;

import javax.swing.plaf.FontUIResource;

import org.jvnet.substance.fonts.FontSet;

public class WrapperFontSet implements FontSet {

	private static final long serialVersionUID = 1L;

	private FontSet delegate;
	
	private static String fontNameString;
	
	private static int fontSizeIncreaseNumber;
	
	public static void setFontName(String fontName) {
		fontNameString = fontName; 
	}
	
	public static void setFontSizeIncrease(int fontSizeIncrease) {
		fontSizeIncreaseNumber = fontSizeIncrease;
	}

	public WrapperFontSet(FontSet delegate) {
		super();
		this.delegate = delegate;
	}

	private FontUIResource getWrappedFont(FontUIResource systemFont) {
		return new FontUIResource(fontNameString, systemFont.getStyle(), systemFont.getSize() + fontSizeIncreaseNumber);
	}

	public FontUIResource getControlFont() {
		return this.getWrappedFont(this.delegate.getControlFont());
	}

	public FontUIResource getMenuFont() {
		return this.getWrappedFont(this.delegate.getMenuFont());
	}

	public FontUIResource getMessageFont() {
		return this.getWrappedFont(this.delegate.getMessageFont());
	}

	public FontUIResource getSmallFont() {
		return this.getWrappedFont(this.delegate.getSmallFont());
	}

	public FontUIResource getTitleFont() {
		return this.getWrappedFont(this.delegate.getTitleFont());
	}

	public FontUIResource getWindowTitleFont() {
		return this.getWrappedFont(this.delegate.getWindowTitleFont());
	}

}
